package com.lx.huimail.configs;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Environment;


import java.io.File;
import java.util.ArrayList;
import java.util.Map;

public class Config {

	// public static String url = "http://192.168.1.251:8080/qitao/";
	// public static String url_img = "http://192.168.1.251:8080/qitaoService/";

	// public static String url = "http://192.168.1.238:8080/qitao/";
	// public static String url_img = "http://192.168.1.238:8080/qitaoService/";

	// public static String url = "http://192.168.1.203:8080/qitao/";
	// public static String url_img = "http://192.168.1.203:8080/qitaoService/";

	//public static String url = "http://192.168.1.138:8080/qitao/";
	//public static String url_img = "http://192.168.1.138:8080/qitaoService/";

	// public static String url = "http://ljccc.ngrok.natapp.cn/qitao/";
	// public static String url_img = "http://192.168.1.138:8080/qitaoService/";
	public static String url= "http://124.130.131.94:8087/";
	//public static String url ="http://192.168.1.101:8080/springmvc/";
	public static String url2 ="http://192.168.1.138:8080/mth/";
	public static String url3 ="http://192.168.1.235:8080/mth/";
	// public static String url_img = "http://182.92.96.58:8004/qitaoService/";

	public static final String APP_LOC = "com.lianxiang.locinfo";
	//已登录
	public static final String INTENT_ACTION_LOGIN = "com.qixin.huimall.action.LOGIN";

	//未登录
	public static final String INTENT_ACTION_LOGOUT = "com.qixin.huimall.action.LOGOUT";

	public static final String INTENT_ACTION_USER_CHANGE = "com.qixin.huimall.action.USER_CHANGE";
	public static boolean StopUpdate;

	public static final String DISK_CACHE_PATHS = Environment
			.getExternalStorageDirectory().getPath() + File.separator + "qitao";

	public static String ACTION = "action";

	public static int ROWS_DEF = 20;

	public static Map<String, String> self = null;
	public static String accountid = "";

	public static int islogin = 0;
	public static Boolean isHttpPost = false;

	public static String APP_ID = "";
	public static String APP_LOGIN = "";
	public static String APP_VERSION = "";
	public static String KEY_ACCOUNT = "userNm";
	public static String KEY_PASSWORD = "pwd";
	public static String KEY_ROOTPATH = "rootpath";
	public static String KEY_IMEI = "imei";

	/**
	 * 保存服务器地�?
	 * 
	 * @return
	 */
	public static void setrootpath(Context context, String path) {
		// ROOTPATH = path;
		SharedPreferences.Editor e = context.getSharedPreferences(APP_ID,
				Context.MODE_PRIVATE).edit();
		e.putString(KEY_ROOTPATH, path);

		e.commit();
	}

	/**
	 * 将将账号密码保存
	 */
	public static void cacheUserAndPas(Context context, String username,
			String password, String cbType) {
		SharedPreferences.Editor e = context.getSharedPreferences(APP_ID,
				Context.MODE_PRIVATE).edit();
		e.putString(KEY_ACCOUNT, username);
		e.putString(KEY_PASSWORD, password);
		e.commit();
	}

	/**
	 * 将客户信息保�?
	 */
	public static void saveAccountUpTime(Context context, String key,
			String value) {
		SharedPreferences.Editor e = context.getSharedPreferences(APP_LOGIN,
				Context.MODE_PRIVATE).edit();
		try {
			Integer.parseInt(value);
			e.putInt(key, Integer.parseInt(value));
		} catch (Exception e1) {
			e.putInt(key, 10);
		}
		e.commit();
	}

	/**
	 * 将客户信息保�?
	 */
	public static void saveAccount(Context context, String key, String value) {
		SharedPreferences.Editor e = context.getSharedPreferences(APP_LOGIN,
				Context.MODE_PRIVATE).edit();
		e.putString(key, value);

		e.commit();
	}

}
